package com.shenbianyun.ycx;

import com.alibaba.fastjson.JSONObject;
import com.shenbianyun.bosskgpay.entity.Merchant;
import com.shenbianyun.bosskgpay.entity.Person;
import com.shenbianyun.bosskgpay.entity.RequestMessage;
import com.shenbianyun.bosskgpay.entity.sign.UserSignReqModel;
import com.shenbianyun.bosskgpay.utils.*;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient;
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext;
import org.apache.jmeter.samplers.SampleResult;

/**
 * @author ：张一凡
 * @date ：2023年11月01日 18:24:33
 * @description：易畅行生产个人签约
 */
public class YCXTestUserSignServiceJOline extends AbstractJavaSamplerClient {



    public final String CHARSET_UTF_8 = "UTF-8";
    public final String MER_ID = "1697534870141137";
    public final String MER_PRIVATE_KEY = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANI9mMMSLm+Baqw2CwTTytpSFOwwHX/udkgyy0agQ5Tgw1GEIeelYlTUg8Qsl1mYK6ftpoV2pUXsPiDmrSQ5gxPs6q6axwzbvGzKqTL+sU+nHdWUnlxolJN4Xfzyr+hzFdHkFRmAL72wbP/Hnpoeo/BiJLDJraZHTqiQsYvQVK3xAgMBAAECgYAE0yUOVPx70pyAFz1pfvLIz9lrEi+bH/3W6lN/622hnQbeeAnPJxx6leXwOpW+mJ9n2yxXI8HnOOS0HJccnbVEVSR5M4KeB08t7G6+ADY42DBAn4//LFTjfqbgvG+X2ECbWBALWbXgMS66v1L22RpnmJGHJsV3vfNrkkFLtAwjgQJBAO7Nxwzr1CxZ2kZyNs1e3s3bdKwk2H2NKC4CktjJF7aIVu0ck9m/DDooCCy/wUQ72fKGz5qmFI58lC1vRR2hoOcCQQDhYUWDrKlg4a5/VePcLX68ehH1/HQz3pj8VhJjYKPTn+6Yb8VZ+ea6ib6+qg1EZ/f49ROEB9KAc9z0IfFc8GdnAkEAxPCv19glgu4XNUG8MGKtHNh/v/gjEmf3WvqEYIR3KfIGvkVzKYCFdPDOzRjXKo6xj3HehIuzKE9VZKL/PRCuwQJBAJvbkZ/qYkOOLgb+1ZFooNEkNZF/oLhSAkfWGedBaGmrmustuDNtvuJW6WKe5IfewjwW9wUCB88u0Ki/ZFNaKJcCQAmyID6pNpPKv9NpIYVXFr0Nvh3nbPd8p5Hyxqtw+qGTa64MiHdWCHV5C5+DXa29wtgUDce6d5OiOTNC9KA8dbY=";
    public final String MER_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDSPZjDEi5vgWqsNgsE08raUhTsMB1/7nZIMstGoEOU4MNRhCHnpWJU1IPELJdZmCun7aaFdqVF7D4g5q0kOYMT7OqumscM27xsyqky/rFPpx3VlJ5caJSTeF388q/ocxXR5BUZgC+9sGz/x56aHqPwYiSwya2mR06okLGL0FSt8QIDAQAB";
    public final String INTER_KEY = "F44D36620515AA071476355A3E42A192";
    public final String API_VERSION = "V1.0";
    public final String OMS_TEST_URL = "http://gateway.ycxlg.com/ycx/clientapi/clientBusiness/common";


    //商户
    private static Merchant mer = new Merchant();
    //公共参数
    public static RequestMessage rm = new RequestMessage();
    //签约者
    public static Person p = new Person();
    //业务参数
    public static UserSignReqModel proSign = null;

    public String runTestUserSignService(JavaSamplerContext javaSamplerContext) throws Exception {

        //商户
        //mer = new Merchant();
        // 商户id
        mer.setMerid(Long.valueOf(javaSamplerContext.getParameter("MER_ID")));
        // 商户私钥
        mer.setPriKey(MER_PRIVATE_KEY);
        // 商户公钥
        mer.setPubKey(MER_PUBLIC_KEY);
        // 商户签名
        mer.setInterKey(javaSamplerContext.getParameter("INTER_KEY"));


        //公共参数
        //RequestMessage rm = new RequestMessage();
        rm.setFunCode("6010");
        rm.setMerId(mer.getMerid());
        rm.setVersion(API_VERSION);
        rm.setReqId(rm.getFunCode() + System.currentTimeMillis());

        //签约者
        //Person p = new Person();

        //签约付款类型 0：银行卡，1：支付宝，2：微信
        p.setPaymentType("1");
        //收款人
        //p.setName(new RandInfo().randFamilyName());
        p.setName(javaSamplerContext.getParameter("Name"));
        //收款卡号
        //p.setPayAcc("6214830114752289");
        //p.setPayAcc(javaSamplerContext.getParameter("PayAcc"));
        //收款身份证号
        //p.setIdcard(new IDCard().getIDCard());
        p.setIdcard(javaSamplerContext.getParameter("Idcard"));
        //手机号
        //p.setMobile("13167558700");
        p.setMobile(javaSamplerContext.getParameter("Mobile"));

        //把person添加到自由职业者签约的参数中
        proSign = new UserSignReqModel(p.getName()
                , p.getPayAcc()
                , p.getMobile()
                , 0
                , 1
                , Integer.parseInt(javaSamplerContext.getParameter("levy_id"))
                , p.getIdcard());

        //设置照片
        //String filePathOn = "http://192.168.40.84:8888/group1/M00/02/7D/wKgoVGPtmICAHSWtAAl0j6fMl28379.png";
        //String filePathBack = "http://192.168.40.84:8888/group1/M00/02/7E/wKgoVWPtmIWAJGF3AAn2SK9R8aw444.png";
        //String filePathOn = "ffd8ffe000104a46494600010100009000900000ffe100744578696600004d4d002a000000080004011a0005000000010000003e011b0005000000010000004601280003000000010002000087690004000000010000004e00000000000000900000000100000090000000010002a0020004000000010000000ca0030004000000010000000e00000000ffed003850686f746f73686f7020332e30003842494d04040000000000003842494d0425000000000010d41d8cd98f00b204e9800998ecf8427effe210084943435f50524f46494c4500010100000ff86170706c021000006d6e74725247422058595a2007e50009001900010015003b616373704150504c000000004150504c000000000000000000000000000000000000f6d6000100000000d32d6170706c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012646573630000015c000000626473636d000001c00000049c637072740000065c000000237774707400000680000000147258595a00000694000000146758595a000006a8000000146258595a000006bc0000001472545243000006d00000080c6161726700000edc000000207663677400000efc000000306e64696e00000f2c0000003e6368616400000f6c0000002c6d6d6f6400000f98000000287663677000000fc00000003862545243000006d00000080c67545243000006d00000080c6161626700000edc000000206161676700000edc00000020646573630000000000000008446973706c61790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d6c756300000000000000260000000c6872485200000014000001d86b6f4b520000000c000001ec6e624e4f00000012000001f869640000000000120000020a68754855000000140000021c6373435a00000016000002306461444b0000001c000002466e6c4e4c00000016000002626669464900000010000002786974495400000018000002886573455300000016000002a0726f524f00000012000002b66672434100000016000002c86172000000000014000002de756b55410000001c000002f26865494c000000160000030e7a6854570000000a000003247669564e0000000e0000032e736b534b000000160000033c7a68434e0000000a00000324727552550000002400000352656e4742000000140000037666724652000000160000038a6d73000000000012000003a06869494e00000012000003b2746854480000000c000003c46361455300000018000003d0656e415500000014000003766573584c00000012000002b66465444500000010000003e8656e555300000012000003f870744252000000180000040a706c504c0000001200000422656c4752000000220000043473765345000000100000045674725452000000140000046670745054000000160000047a6a614a500000000c00000490004c004300440020007500200062006f006a0069ceecb7ec0020004c0043004400460061007200670065002d004c00430044004c004300440020005700610072006e00610053007a00ed006e006500730020004c0043004400420061007200650076006e00fd0020004c00430044004c00430044002d006600610072007600650073006b00e60072006d004b006c0065007500720065006e002d004c00430044005600e400720069002d004c00430044004c004300440020006100200063006f006c006f00720069004c004300440020006100200063006f006c006f0072004c0043004400200063006f006c006f007200410043004c00200063006f0075006c006500750072200f004c00430044002006450644064806460629041a043e043b044c043e0440043e0432043804390020004c00430044200f004c00430044002005e605d105e205d505e005d95f698272004c00430044004c004300440020004d00e0007500460061007200650062006e00fd0020004c004300440426043204350442043d043e043900200416041a002d043404380441043f043b043504390043006f006c006f007500720020004c00430044004c0043004400200063006f0075006c006500750072005700610072006e00610020004c00430044093009020917094009280020004c00430044004c0043004400200e2a0e35004c0043004400200065006e00200063006f006c006f00720046006100720062002d004c004300440043006f006c006f00720020004c00430044004c0043004400200043006f006c006f007200690064006f004b006f006c006f00720020004c00430044038803b303c703c103c903bc03b7002003bf03b803cc03bd03b70020004c00430044004600e400720067002d004c0043004400520065006e006b006c00690020004c00430044004c004300440020006100200043006f00720065007330ab30e930fc004c004300447465787400000000436f70797269676874204170706c6520496e632e2c2032303231000058595a20000000000000f31600010000000116ca58595a2000000000000082f400003d64ffffffbc58595a200000000000004c240000b48500000ae658595a2000000000000027be00000e170000c88b63757276000000000000040000000005000a000f00140019001e00230028002d00320036003b00400045004a004f00540059005e00630068006d00720077007c00810086008b00900095009a009f00a300a800ad00b200b700bc00c100c600cb00d000d500db00e000e500eb00f000f600fb01010107010d01130119011f0125012b01320138013e0145014c0152015901600167016e0175017c0183018b0192019a01a101a901b101b901c101c901d101d901e101e901f201fa0203020c0214021d0226022f02380241024b0254025d02670271027a0284028e029802a202ac02b602c102cb02d502e002eb02f50300030b03160321032d03380343034f035a03660372037e038a039603a203ae03ba03c703d303e003ec03f9040604130420042d043b0448045504630471047e048c049a04a804b604c404d304e104f004fe050d051c052b053a05490558056705770586059605a605b505c505d505e505f6060606160627063706480659066a067b068c069d06af06c006d106e306f507070719072b073d074f076107740786079907ac07bf07d207e507f8080b081f08320846085a086e0882089608aa08be08d208e708fb09100925093a094f09640979098f09a409ba09cf09e509fb0a110a270a3d0a540a6a0a810a980aae0ac50adc0af30b0b0b220b390b510b690b800b980bb00bc80be10bf90c120c2a0c430c5c0c750c8e0ca70cc00cd90cf30d0d0d260d400d5a0d740d8e0da90dc30dde0df80e130e2e0e490e640e7f0e9b0eb60ed20eee0f090f250f410f5e0f7a0f960fb30fcf0fec1009102610431061107e109b10b910d710f511131131114f116d118c11aa11c911e81207122612451264128412a312c312e31303132313431363138313a413c513e5140614271449146a148b14ad14ce14f01512153415561578159b15bd15e0160316261649166c168f16b216d616fa171d17411765178917ae17d217f7181b18401865188a18af18d518fa19201945196b199119b719dd1a041a2a1a511a771a9e1ac51aec1b141b3b1b631b8a1bb21bda1c021c2a1c521c7b1ca31ccc1cf51d1e1d471d701d991dc31dec1e161e401e6a1e941ebe1ee91f131f3e1f691f941fbf1fea20152041206c209820c420f0211c2148217521a121ce21fb22272255228222af22dd230a23382366239423c223f0241f244d247c24ab24da250925382568259725c725f726272657268726b726e827182749277a27ab27dc280d283f287128a228d429062938296b299d29d02a022a352a682a9b2acf2b022b362b692b9d2bd12c052c392c6e2ca22cd72d0c2d412d762dab2de12e162e4c2e822eb72eee2f242f5a2f912fc72ffe3035306c30a430db3112314a318231ba31f2322a3263329b32d4330d3346337f33b833f1342b3465349e34d83513354d358735c235fd3637367236ae36e937243760379c37d738143850388c38c839053942397f39bc39f93a363a743ab23aef3b2d3b6b3baa3be83c273c653ca43ce33d223d613da13de03e203e603ea03ee03f213f613fa23fe24023406440a640e74129416a41ac41ee4230427242b542f7433a437d43c044034447448a44ce45124555459a45de4622466746ab46f04735477b47c04805484b489148d7491d496349a949f04a374a7d4ac44b0c4b534b9a4be24c2a4c724cba4d024d4a4d934ddc4e254e6e4eb74f004f494f934fdd5027507150bb51065150519b51e65231527c52c75313535f53aa53f65442548f54db5528557555c2560f565c56a956f75744579257e0582f587d58cb591a596959b85a075a565aa65af55b455b955be55c355c865cd65d275d785dc95e1a5e6c5ebd5f0f5f615fb36005605760aa60fc614f61a261f56249629c62f06343639763eb6440649464e9653d659265e7663d669266e8673d679367e9683f689668ec6943699a69f16a486a9f6af76b4f6ba76bff6c576caf6d086d606db96e126e6b6ec46f1e6f786fd1702b708670e0713a719571f0724b72a67301735d73b87414747074cc7528758575e1763e769b76f8775677b37811786e78cc792a798979e77a467aa57b047b637bc27c217c817ce17d417da17e017e627ec27f237f847fe5804780a8810a816b81cd8230829282f4835783ba841d848084e3854785ab860e867286d7873b879f8804886988ce8933899989fe8a648aca8b308b968bfc8c638cca8d318d988dff8e668ece8f368f9e9006906e90d6913f91a89211927a92e3934d93b69420948a94f4955f95c99634969f970a977597e0984c98b89924999099fc9a689ad59b429baf9c1c9c899cf79d649dd29e409eae9f1d9f8b9ffaa069a0d8a147a1b6a226a296a306a376a3e6a456a4c7a538a5a9a61aa68ba6fda76ea7e0a852a8c4a937a9a9aa1caa8fab02ab75abe9ac5cacd0ad44adb8ae2daea1af16af8bb000b075b0eab160b1d6b24bb2c2b338b3aeb425b49cb513b58ab601b679b6f0b768b7e0b859b8d1b94ab9c2ba3bbab5bb2ebba7bc21bc9bbd15bd8fbe0abe84beffbf7abff5c070c0ecc167c1e3c25fc2dbc358c3d4c451c4cec54bc5c8c646c6c3c741c7bfc83dc8bcc93ac9b9ca38cab7cb36cbb6cc35ccb5cd35cdb5ce36ceb6cf37cfb8d039d0bad13cd1bed23fd2c1d344d3c6d449d4cbd54ed5d1d655d6d8d75cd7e0d864d8e8d96cd9f1da76dafbdb80dc05dc8add10dd96de1cdea2df29dfafe036e0bde144e1cce253e2dbe363e3ebe473e4fce584e60de696e71fe7a9e832e8bce946e9d0ea5beae5eb70ebfbec86ed11ed9cee28eeb4ef40efccf058f0e5f172f1fff28cf319f3a7f434f4c2f550f5def66df6fbf78af819f8a8f938f9c7fa57fae7fb77fc07fc98fd29fdbafe4bfedcff6dffff706172610000000000030000000266660000f2a700000d59000013d000000a5b7663677400000000000000010001000000000000000100000001000000000000000100000001000000000000000100006e64696e00000000000000360000ae0000005200000043c00000b0c00000268000000d4000005000000054400002333300023333000233330000000000000000736633320000000000010c72000005f8fffff31d000007ba0000fd72fffffb9dfffffda4000003d90000c0716d6d6f6400000000000006100000a03000000000d21fb300000000000000000000000000000000007663677000000000000300000002666600030000000266660003000000026666000000023333340000000002333334000000000233333400ffc0001108000e000c03012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffdb004300020202020202030202030503030305060505050506080606060606080a0808080808080a0a0a0a0a0a0a0a0c0c0c0c0c0c0e0e0e0e0e0f0f0f0f0f0f0f0f0f0fffdb00430102020204040407040407100b090b1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010ffdd00040001ffda000c03010002110311003f00fd7f6381d6aa34a01a9a76ef8e95cfcb70439eb5f4bcc7887fffd9";
        //String filePathBack = "ffd8ffe000104a46494600010100009000900000ffe100744578696600004d4d002a000000080004011a0005000000010000003e011b0005000000010000004601280003000000010002000087690004000000010000004e00000000000000900000000100000090000000010002a0020004000000010000000ca0030004000000010000000e00000000ffed003850686f746f73686f7020332e30003842494d04040000000000003842494d0425000000000010d41d8cd98f00b204e9800998ecf8427effe210084943435f50524f46494c4500010100000ff86170706c021000006d6e74725247422058595a2007e50009001900010015003b616373704150504c000000004150504c000000000000000000000000000000000000f6d6000100000000d32d6170706c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012646573630000015c000000626473636d000001c00000049c637072740000065c000000237774707400000680000000147258595a00000694000000146758595a000006a8000000146258595a000006bc0000001472545243000006d00000080c6161726700000edc000000207663677400000efc000000306e64696e00000f2c0000003e6368616400000f6c0000002c6d6d6f6400000f98000000287663677000000fc00000003862545243000006d00000080c67545243000006d00000080c6161626700000edc000000206161676700000edc00000020646573630000000000000008446973706c61790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d6c756300000000000000260000000c6872485200000014000001d86b6f4b520000000c000001ec6e624e4f00000012000001f869640000000000120000020a68754855000000140000021c6373435a00000016000002306461444b0000001c000002466e6c4e4c00000016000002626669464900000010000002786974495400000018000002886573455300000016000002a0726f524f00000012000002b66672434100000016000002c86172000000000014000002de756b55410000001c000002f26865494c000000160000030e7a6854570000000a000003247669564e0000000e0000032e736b534b000000160000033c7a68434e0000000a00000324727552550000002400000352656e4742000000140000037666724652000000160000038a6d73000000000012000003a06869494e00000012000003b2746854480000000c000003c46361455300000018000003d0656e415500000014000003766573584c00000012000002b66465444500000010000003e8656e555300000012000003f870744252000000180000040a706c504c0000001200000422656c4752000000220000043473765345000000100000045674725452000000140000046670745054000000160000047a6a614a500000000c00000490004c004300440020007500200062006f006a0069ceecb7ec0020004c0043004400460061007200670065002d004c00430044004c004300440020005700610072006e00610053007a00ed006e006500730020004c0043004400420061007200650076006e00fd0020004c00430044004c00430044002d006600610072007600650073006b00e60072006d004b006c0065007500720065006e002d004c00430044005600e400720069002d004c00430044004c004300440020006100200063006f006c006f00720069004c004300440020006100200063006f006c006f0072004c0043004400200063006f006c006f007200410043004c00200063006f0075006c006500750072200f004c00430044002006450644064806460629041a043e043b044c043e0440043e0432043804390020004c00430044200f004c00430044002005e605d105e205d505e005d95f698272004c00430044004c004300440020004d00e0007500460061007200650062006e00fd0020004c004300440426043204350442043d043e043900200416041a002d043404380441043f043b043504390043006f006c006f007500720020004c00430044004c0043004400200063006f0075006c006500750072005700610072006e00610020004c00430044093009020917094009280020004c00430044004c0043004400200e2a0e35004c0043004400200065006e00200063006f006c006f00720046006100720062002d004c004300440043006f006c006f00720020004c00430044004c0043004400200043006f006c006f007200690064006f004b006f006c006f00720020004c00430044038803b303c703c103c903bc03b7002003bf03b803cc03bd03b70020004c00430044004600e400720067002d004c0043004400520065006e006b006c00690020004c00430044004c004300440020006100200043006f00720065007330ab30e930fc004c004300447465787400000000436f70797269676874204170706c6520496e632e2c2032303231000058595a20000000000000f31600010000000116ca58595a2000000000000082f400003d64ffffffbc58595a200000000000004c240000b48500000ae658595a2000000000000027be00000e170000c88b63757276000000000000040000000005000a000f00140019001e00230028002d00320036003b00400045004a004f00540059005e00630068006d00720077007c00810086008b00900095009a009f00a300a800ad00b200b700bc00c100c600cb00d000d500db00e000e500eb00f000f600fb01010107010d01130119011f0125012b01320138013e0145014c0152015901600167016e0175017c0183018b0192019a01a101a901b101b901c101c901d101d901e101e901f201fa0203020c0214021d0226022f02380241024b0254025d02670271027a0284028e029802a202ac02b602c102cb02d502e002eb02f50300030b03160321032d03380343034f035a03660372037e038a039603a203ae03ba03c703d303e003ec03f9040604130420042d043b0448045504630471047e048c049a04a804b604c404d304e104f004fe050d051c052b053a05490558056705770586059605a605b505c505d505e505f6060606160627063706480659066a067b068c069d06af06c006d106e306f507070719072b073d074f076107740786079907ac07bf07d207e507f8080b081f08320846085a086e0882089608aa08be08d208e708fb09100925093a094f09640979098f09a409ba09cf09e509fb0a110a270a3d0a540a6a0a810a980aae0ac50adc0af30b0b0b220b390b510b690b800b980bb00bc80be10bf90c120c2a0c430c5c0c750c8e0ca70cc00cd90cf30d0d0d260d400d5a0d740d8e0da90dc30dde0df80e130e2e0e490e640e7f0e9b0eb60ed20eee0f090f250f410f5e0f7a0f960fb30fcf0fec1009102610431061107e109b10b910d710f511131131114f116d118c11aa11c911e81207122612451264128412a312c312e31303132313431363138313a413c513e5140614271449146a148b14ad14ce14f01512153415561578159b15bd15e0160316261649166c168f16b216d616fa171d17411765178917ae17d217f7181b18401865188a18af18d518fa19201945196b199119b719dd1a041a2a1a511a771a9e1ac51aec1b141b3b1b631b8a1bb21bda1c021c2a1c521c7b1ca31ccc1cf51d1e1d471d701d991dc31dec1e161e401e6a1e941ebe1ee91f131f3e1f691f941fbf1fea20152041206c209820c420f0211c2148217521a121ce21fb22272255228222af22dd230a23382366239423c223f0241f244d247c24ab24da250925382568259725c725f726272657268726b726e827182749277a27ab27dc280d283f287128a228d429062938296b299d29d02a022a352a682a9b2acf2b022b362b692b9d2bd12c052c392c6e2ca22cd72d0c2d412d762dab2de12e162e4c2e822eb72eee2f242f5a2f912fc72ffe3035306c30a430db3112314a318231ba31f2322a3263329b32d4330d3346337f33b833f1342b3465349e34d83513354d358735c235fd3637367236ae36e937243760379c37d738143850388c38c839053942397f39bc39f93a363a743ab23aef3b2d3b6b3baa3be83c273c653ca43ce33d223d613da13de03e203e603ea03ee03f213f613fa23fe24023406440a640e74129416a41ac41ee4230427242b542f7433a437d43c044034447448a44ce45124555459a45de4622466746ab46f04735477b47c04805484b489148d7491d496349a949f04a374a7d4ac44b0c4b534b9a4be24c2a4c724cba4d024d4a4d934ddc4e254e6e4eb74f004f494f934fdd5027507150bb51065150519b51e65231527c52c75313535f53aa53f65442548f54db5528557555c2560f565c56a956f75744579257e0582f587d58cb591a596959b85a075a565aa65af55b455b955be55c355c865cd65d275d785dc95e1a5e6c5ebd5f0f5f615fb36005605760aa60fc614f61a261f56249629c62f06343639763eb6440649464e9653d659265e7663d669266e8673d679367e9683f689668ec6943699a69f16a486a9f6af76b4f6ba76bff6c576caf6d086d606db96e126e6b6ec46f1e6f786fd1702b708670e0713a719571f0724b72a67301735d73b87414747074cc7528758575e1763e769b76f8775677b37811786e78cc792a798979e77a467aa57b047b637bc27c217c817ce17d417da17e017e627ec27f237f847fe5804780a8810a816b81cd8230829282f4835783ba841d848084e3854785ab860e867286d7873b879f8804886988ce8933899989fe8a648aca8b308b968bfc8c638cca8d318d988dff8e668ece8f368f9e9006906e90d6913f91a89211927a92e3934d93b69420948a94f4955f95c99634969f970a977597e0984c98b89924999099fc9a689ad59b429baf9c1c9c899cf79d649dd29e409eae9f1d9f8b9ffaa069a0d8a147a1b6a226a296a306a376a3e6a456a4c7a538a5a9a61aa68ba6fda76ea7e0a852a8c4a937a9a9aa1caa8fab02ab75abe9ac5cacd0ad44adb8ae2daea1af16af8bb000b075b0eab160b1d6b24bb2c2b338b3aeb425b49cb513b58ab601b679b6f0b768b7e0b859b8d1b94ab9c2ba3bbab5bb2ebba7bc21bc9bbd15bd8fbe0abe84beffbf7abff5c070c0ecc167c1e3c25fc2dbc358c3d4c451c4cec54bc5c8c646c6c3c741c7bfc83dc8bcc93ac9b9ca38cab7cb36cbb6cc35ccb5cd35cdb5ce36ceb6cf37cfb8d039d0bad13cd1bed23fd2c1d344d3c6d449d4cbd54ed5d1d655d6d8d75cd7e0d864d8e8d96cd9f1da76dafbdb80dc05dc8add10dd96de1cdea2df29dfafe036e0bde144e1cce253e2dbe363e3ebe473e4fce584e60de696e71fe7a9e832e8bce946e9d0ea5beae5eb70ebfbec86ed11ed9cee28eeb4ef40efccf058f0e5f172f1fff28cf319f3a7f434f4c2f550f5def66df6fbf78af819f8a8f938f9c7fa57fae7fb77fc07fc98fd29fdbafe4bfedcff6dffff706172610000000000030000000266660000f2a700000d59000013d000000a5b7663677400000000000000010001000000000000000100000001000000000000000100000001000000000000000100006e64696e00000000000000360000ae0000005200000043c00000b0c00000268000000d4000005000000054400002333300023333000233330000000000000000736633320000000000010c72000005f8fffff31d000007ba0000fd72fffffb9dfffffda4000003d90000c0716d6d6f6400000000000006100000a03000000000d21fb300000000000000000000000000000000007663677000000000000300000002666600030000000266660003000000026666000000023333340000000002333334000000000233333400ffc0001108000e000c03012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffdb004300020202020202030202030503030305060505050506080606060606080a0808080808080a0a0a0a0a0a0a0a0c0c0c0c0c0c0e0e0e0e0e0f0f0f0f0f0f0f0f0f0fffdb00430102020204040407040407100b090b1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010ffdd00040001ffda000c03010002110311003f00fd7f6381d6aa34a01a9a76ef8e95cfcb70439eb5f4bcc7887fffd9";
        //proSign.setIdCardPic1(filePathOn);
        //proSign.setIdCardPic2(filePathBack);

        //reqData转json
        String reqData = JsonUtils.toJson(proSign);
        System.out.println("reqDatajson= " + reqData);

        //reqData加密
        byte[] bs = DESUtils.encrypt(reqData.getBytes(CHARSET_UTF_8), mer.getInterKey());
        String reqDataEncrypt = Base64Utils.encodeToString(bs);
        rm.setReqData(reqDataEncrypt);
        rm.setSign(RSAUtils.sign(reqDataEncrypt, mer.getPriKey()));

        String reqStr = JsonUtils.toJson(rm);
        //System.out.println("请求数据：" + reqStr);


        String resData = HttpClientHelper.sendPost(OMS_TEST_URL, "application/json", reqStr, "POST", CHARSET_UTF_8);
        //System.out.println("响应数据：" + resData);
        return resData;
    }


    @Override
    public Arguments getDefaultParameters() {
        Arguments params = new Arguments();
        params.addArgument("MER_ID", MER_ID);//设置参数，商户id
        params.addArgument("INTER_KEY", INTER_KEY);//设置参数，并赋予默认值2
        params.addArgument("levy_id", "35304");//设置参数，服务商id
        params.addArgument("Name", new RandInfo().randFamilyName());//设置参数，签约者姓名
        //params.addArgument("PayAcc","6214830114752289");//设置参数，签约者收款卡号
        params.addArgument("Idcard", new IDCard().getIDCard());//设置参数，签约者身份证号
        params.addArgument("Mobile", "13167558700");//设置参数，签约者手机号
        return params;
    }


    @Override
    public SampleResult runTest(JavaSamplerContext javaSamplerContext) {
        SampleResult sampleResult = new SampleResult();
        String resData = "";
        try {
            sampleResult.sampleStart();
            resData = runTestUserSignService(javaSamplerContext);

            //断言
            JSONObject jsonObject1 = JSONObject.parseObject(resData);
            if (jsonObject1.get("resCode").equals("0000")) {
                sampleResult.setResponseOK();
                sampleResult.setResponseData(true + "", SampleResult.TEXT);
                System.out.println("签约结果:" + true);
            } else {
                sampleResult.setSuccessful(false);
                sampleResult.setResponseData(false + " " + jsonObject1.get("resMsg"), SampleResult.TEXT);
                System.out.println("签约结果:" + false + " " + jsonObject1.get("resMsg"));
            }
        } catch (Exception e) {
            sampleResult.setSuccessful(false);
            sampleResult.setResponseData(resData, SampleResult.TEXT);
            sampleResult.setResponseMessage(e.toString());
        } finally {
            sampleResult.sampleEnd();
        }

        return sampleResult;
    }







}
